package arithmetic.someAlgorithm;


/**
 * 饿汉式单例模式
 * @author lidd
 *
 */
public class Singleton1 {

	private static Singleton1 singleton = new Singleton1();
	private Singleton1() {}
	public static Singleton1 getInstance() {
		return singleton;
	}

	public void print() {
		System.out.println("哈哈哈");
	}

	public static void main(String[] args) {
		/*Singleton2 s = Singleton2.getInstance();
		s.print();*/

		Singleton3 single = Singleton3.INSTANCE;
		single.print();
	}
}
